<?php
require_once 'glob.php';
//chkcity();
$city=$_SESSION['city'];
$amount=$db->getcount('sn_group_goods',"where city = '".$city."' and isdel= 'N' and overtime < '".date('Y-m-d H:i:s')."'");
//产生分页条
if($amount!==0){
	$pagefy=$pageination->pageination_lab($_REQUEST['page'], $amount,18,1);
	$xueniao->assign('pagebar',$pagefy['pagelab']);
	$sql="select id,DATE(overtime) as overtime,name as name,smallimg as smallimg,salenum as salenum,costprice as costprice,groupprice as groupprice,ROUND(((groupprice/costprice)*10),1) as agio,(costprice-groupprice) as save from sn_group_goods where city = '".$city."' and isdel= 'N' and overtime < '".date('Y-m-d H:i:s')."' limit ".$pagefy['start'].','.$pagefy['step'];
	$oldlist=$db->getlist($sql);
	$xueniao->assign('oldlist',$oldlist);
	$xueniao->display('list.htm');
}else{
	$msg=array(
	title=>'尚无往期团购',
	nottitle=>'系统提示',
	cont=>'该城市尚无往期团购！',
	butlink=>'<a href="javascript:history.go(-1)">返回上一页</a>',
	other=>''
	);
	$xueniao->assign('msg',$msg);
	$xueniao->display('message.htm');
}
//*/
//get_list('oldlist', array( id,DATE(overtime) as overtime,name as name,smallimg as smallimg,salenum as salenum,costprice as costprice,groupprice as groupprice,ROUND(((groupprice/costprice)*10),1) as agio,(costprice-groupprice) as save),'oldlist','list.htm','fypage',$page,"where city = '".$city."' and isdel= 'N' and overtime < '".date('Y-m-d H:i:s')."'");


?>